package com.lgl.blog.controller;

import com.lgl.blog.mapper.BlogMapper;
import com.lgl.blog.pojo.Blog;
import com.lgl.blog.service.IBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Auther: Brook
 * @Date: 2020/10/1 15:59
 * @Description:
 */
@Controller
public class ListController {
    @Autowired
    private IBlogService blogService;

    @RequestMapping("/findList")
    public String findList(Model model, Integer page, Integer size) {

        Page<Blog> list = blogService.findList(page, size);
        model.addAttribute("page", list);

        return "client/index";
    }
}
